/**
 * MeetSummaryServiceImpl.java
 */
package com.prs.crm.service.meeting.impl;

import java.io.File;
import java.util.Collection;
import java.util.List;

import com.prs.crm.context.Attach;
import com.prs.crm.context.Constrains;
import com.prs.crm.context.FileUtil;
import com.prs.crm.dao.meeting.MeetSummaryDao;
import com.prs.crm.domain.meeting.MeetStart;
import com.prs.crm.domain.meeting.MeetSummary;
import com.prs.crm.service.impl.BaseServiceImpl;
import com.prs.crm.service.meeting.MeetSummaryService;

/**
 * @author ZhuDongMei
 * @E-mail:1223984339@qq.com
 * @qq:1223984339
 * @version 创建时间：2011-3-16 上午11:12:28 简单说明
 */

public class MeetSummaryServiceImpl extends BaseServiceImpl<MeetSummary, MeetSummaryDao> implements
		MeetSummaryService {

	@Override
	public List<MeetSummary> getAllMeetSummary() {
		// TODO Auto-generated method stub
		return this.getDao().getAllMeetSummary();
	}

	@Override
	public MeetSummary getMeetSummaryById(MeetStart meetStart) {
		// TODO Auto-generated method stub
		return this.getDao().getMeetSummaryById(meetStart);
	}

	@Override
	public MeetSummary getMeetSummaryById(Integer id) {
		// TODO Auto-generated method stub
		return this.getDao().getMeetSummaryById(id);
	}

	@Override
	public void saveMeetSummary(MeetSummary meetSummary, File file,
			String fileName) {
		meetSummary.setAttach(FileUtil.getInstance().createAttach(file, fileName));
		this.getDao().save(meetSummary);
	}
	@Override
	public void saveMeetSummarys(MeetSummary meetSummary, File file,
			String fileName) {
     Attach cAttach=FileUtil.getInstance().saveFile(file, fileName,"",Constrains.UPLOAD_DIR_MEETSUMMARY);
		
		if(cAttach.getSrc()!=null){
			meetSummary.setMeetSummary_file(cAttach.getSrc());
		}
		this.getDao().save(meetSummary);
	}
	}

